<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>Spring Travel: Spring MVC and Web Flow Reference Application</title>
	
	<link type="text/css" rel="stylesheet" href="<c:url value="/resources/css/smoothness/jquery-ui-1.8.23.custom.css" />" />
	<link type="text/css" rel="stylesheet" href="<c:url value="/resources/css/demos.css" />" />
	<script type="text/javascript" src="<c:url value="/resources/js/jquery-1.8.2.js" /> "></script>
	<script type="text/javascript" src="<c:url value="/resources/js/jquery-ui-1.8.23.custom.min.js" /> "></script>
	<script type="text/javascript" src="<c:url value="/resources/dojo/dojo.js" />"></script>
	<script type="text/javascript" src="<c:url value="/resources/spring/Spring.js" />"></script>
	<script type="text/javascript" src="<c:url value="/resources/spring/Spring-Dojo.js" />"></script>
</head>
<body>
<div id="page" >
	<div id="header">
		<div id="topbar" >
			<p>
				<c:if test="${not empty SPRING_SECURITY_CONTEXT.authentication.principal.username}">
					Welcome, <c:out value="${SPRING_SECURITY_CONTEXT.authentication.principal.username}"/>
					<a href="<c:url value="/j_spring_security_logout" />">Logout</a>
					<security:authorize ifAllGranted="ROLE_ADMIN">
						<a href="<c:url value="/users/register" />">Register</a>
					</security:authorize>
				</c:if>
				<c:if test="${empty SPRING_SECURITY_CONTEXT.authentication.principal.username}">
					Welcome, User
				<a href="<c:url value="/login" />">Login</a>
				</c:if>
		</div>
		<div id="menu">
			<tiles:insertAttribute name="menu" />
		</div>
	</div>
	<div id="content">
		<div id="main">
			<tiles:insertAttribute name="body" />
		</div>
		<div id="local">
			<tiles:insertAttribute name="nav" />
		</div>
	</div>
	<hr />
	<div id="footer">
		<tiles:insertAttribute name="footer" />
	</div>
</div>
</body>
</html>